package com.vectrics.hosting;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.jsp.JspException;

import org.vectrics.common.db.SimpleCodedObject;
import org.vectrics.hibernate.ThreadProperties;
import org.vectrics.struts.VectricsActionData;
import org.vectrics.struts.VectricsStrutsAction;

public class ShowChangeThemeAction extends VectricsStrutsAction {

	@Override
	protected String doExecute(VectricsActionData actionData)
			throws JspException {

		ChangeThemeStrutsForm form = new ChangeThemeStrutsForm();
		form.setDomainId(ThreadProperties.getDomain().getId().toString());
		actionData.setRequestForm(form);
		
		List allThemes = new ArrayList();
		
		SimpleCodedObject theme = new SimpleCodedObject();
		theme.setCode("patriot");
		theme.setName("Patriot");
		allThemes.add(theme);

		theme = new SimpleCodedObject();
		theme.setCode("meadow");
		theme.setName("Meadow");
		allThemes.add(theme);

		theme = new SimpleCodedObject();
		theme.setCode("rainforest");
		theme.setName("Rainforest");
		allThemes.add(theme);

		theme = new SimpleCodedObject();
		theme.setCode("ocean");
		theme.setName("Ocean");
		allThemes.add(theme);
		
		actionData.getRequest().setAttribute("themes", allThemes);
		
		return "success";
	}

}
